# Build recipe for rep-gtk
#
# Copyright 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
#
# This recipe is free software, under the terms of the Apache License 2.0

program=rep-gtk
version=0.90.8.3
release=1

tarname=${program}_${version}.tar.bz2

# Remote source(s)
fetch=http://download.tuxfamily.org/librep/rep-gtk/$tarname

description="

"

homepage=http://sawfish.wikia.com/wiki/Main_Page
license=GPLv2

# Source documentation
docs="COPYING ChangeLog NEWS README* TODO"
docsdir="${docdir}/${program}-${version}"

build()
{
    set -e

    unpack "${tardir}/$tarname"

    srcdir=$TMPDIR/${program}_${version}
    cd "$srcdir"

    ./autogen.sh
    ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docdir \
     --build="$(cc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Copy documentation
    mkdir -p "${destdir}${docsdir}"
    cp -p $docs "${destdir}${docsdir}"
}